package com.example.test.service;
import com.example.test.entity.Role;
import com.example.test.mapper.RoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleService {

    //@Resource来自jdk中的注解，可以使用它给引用类型赋值注入(这就是spring的自动注入使用)
    @Resource
    private RoleMapper roleMapper;


    public List<Role> findAll() {
        return roleMapper.findAll();
    }

    public int save(Role role) {
        return roleMapper.save(role);
    }

    public Integer delete(int id) {
        return roleMapper.delete(id);
    }

    public Role get(int id) {
        return roleMapper.get(id);
    }

    public int update(Role role) {
        return roleMapper.update(role);
    }


}
